#pragma once
#include <Windows.h>
#include "Graphics.h"
#include "Input.h"

static int g_scrHeight = 600;
static int g_scrWidth = 800;

LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);

class Engine
{
private:

	HWND		m_hWnd;
	MSG			m_uMsg;
	HINSTANCE	m_hInstance, m_hPrevInstance;
	LPSTR		m_lpCmdLine;
	int			m_nCmdShow;
	HWND OpenWindow(const char* cszWindowName, int nCmdShow);

	Engine();

public:

	bool toQuit;
	Graphics		graphics;
	DInput			input;
	int				m_gameState;

	inline static Engine* Ins() { static Engine e; return &e; }
	void Init(HINSTANCE hInstance,							// to be called once at the beginning of the program
			  HINSTANCE hPrevInstance, 
			  LPSTR lpCmdLine, 
			  int nCmdShow);		
	void Work();											// to be called once per frame
	void Release();											// to be called at the end
	

	WPARAM getWParam() { return m_uMsg.wParam; }
};

